const router = require("koa-router")()
router.prefix("/common")
const token = require('../utils/token')
const { upload, getClassifyList } = require('../services/common')
/**
* @swagger
* tags:
*   name: 通用接口
*   description: 前台展示页面接口API文档(不需要jwt鉴权)
*/
router.post('/upload', token.verifyToken, upload) // 根据产品ID，查询产品详细数据

/**
 * @swagger
 * /common/classify/list:
 *   get:
 *     summary: 查询所有的产品分类
 *     description: 查询所有的产品分类，返回一个分类通用列表
 *     tags: [通用接口]
 *     responses:
 *       '200':
 *         description: Ok
 *         schema:
 *           type: 'object'
 *           properties:
 *             code:
 *               type: 'number'
 *               description: 成功状态码
 *             data:
 *               type: 'object'
 *               description: 返回数据
 *             message:
 *               type: 'string'
 *               description: 消息提示
 *       '400':
 *         description: 操作失败
 *       '404':
 *         description: not found
 *     security:
 *       - Bearer: []
 */
router.get('/classify/list', token.verifyToken, getClassifyList) // 根据产品ID，查询产品详细数据

module.exports = router